#include <stdio.h>
#include <stdlib.h>


union test_un
{
	int i;
	float f;
	double d;
	char ch;


};
//开销:8字节
void print_test_un_size(union test_un a)
{
	printf("szieof(union):%d\n",sizeof(a));
}
//开销：8字节
void print_test_un_size_for_point(union test_un *p)
{

	printf("sizeof(point):%d\n",sizeof(p));

}

int main()
{
#if 0
	union test_un a;
	union test_un *p = &a;


//	a.f = 345.678;
	p->f=345.678;	
	printf("%d\n",sizeof(a));
	
	printf("%f\n",a.f);
//	printf("%d\n",a.i);
	
	printf("%f\n",p->f);



#endif
	union test_un a;

	a.f = 345.678;

	print_test_un_size(a);	
	print_test_un_size_for_point(&a);
	
	exit(0);
}
